import { appStore } from '@/store/modules'
import { http } from '@/utils/http'

import { AppList, Dict, DictParams, MyAppParams } from './model/appModel'

enum AppApi {
  list = '/paas/appClient/getAppInfo',
  dict = '/paas/paasdict/list'
}

/* 应用列表查询 */
export function getMyAppList(data?: MyAppParams) {
  return http.get<AppList[number]>(
    AppApi.list,
    {
      ...data,
      tenantId: appStore.tenantId
    } as Recordable,
    { ignoreParameter: true }
  )
}

/* 字典列表 */
export function getDictionaryList(data?: DictParams) {
  return http.get<Dict>(AppApi.dict, data)
}
